﻿<div>

<h2>JavaScript 代码：</h2>
<textarea name="dp-syntaxhighlighter" class="brush: js; highlight: []" >
    
    $(function () {
        var tt = $("#tt");

        $("#Button1").click(function () {
            tt.toolbar("resize", { width: 800, height: 100 });
        });

        $("#Button2").click(function () {
            tt.toolbar("resize", { width: $.fn.toolbar.defaults.width, height: $.fn.toolbar.defaults.height });
        });

        $("#Button3").click(function () { tt.toolbar("align", "left"); });

        $("#Button4").click(function () { tt.toolbar("align", "center"); });

        $("#Button5").click(function () { tt.toolbar("align", "right"); });

        $("#Button6").click(function () { tt.toolbar("valign", "top"); });

        $("#Button7").click(function () { tt.toolbar("valign", "middle"); });

        $("#Button8").click(function () { tt.toolbar("valign", "bottom"); });

        var i = 1;
        $("#Button9").click(function () {
            var btn = $("<a></a>").linkbutton({ plain: false, text: "按钮" + i++, iconCls: "icon-hamburg-lock" });
            tt.toolbar("append", btn);
        });

        $("#Button10").click(function () {
            tt.toolbar("append", {
                iconCls: "icon-hamburg-lock",
                text: "按钮" + i++,
                handler: function () { alert($(this).text()); }
            });
        });

        $("#Button11").click(function () {
            tt.toolbar("append", function () {
                return {
                    iconCls: "icon-hamburg-lock",
                    text: "按钮" + i++,
                    handler: function () { alert($(this).text()); }
                };
            });
        });

        $("#Button12").click(function () {
            tt.toolbar("append", "-");
        });
    });

</textarea>
<h2>HTML 代码：</h2>
<textarea name="dp-syntaxhighlighter" class="brush: html; highlight: []" >
    
    <hr />
        <input id="Button1" type="button" value="重设工具栏尺寸" />
        <input id="Button2" type="button" value="恢复尺寸" />
        <br /><br />
        <input id="Button3" type="button" value="调整位置-横向-靠左" />
        <input id="Button4" type="button" value="调整位置-横向-居中" />
        <input id="Button5" type="button" value="调整位置-横向-靠右" />
        <br /><br />
        <input id="Button6" type="button" value="调整位置-纵向-靠上" />
        <input id="Button7" type="button" value="调整位置-纵向-居中" />
        <input id="Button8" type="button" value="调整位置-纵向-靠下" />
        <br /><br />
        <input id="Button9" type="button" value="增加一个按钮1" />
        <input id="Button10" type="button" value="增加一个按钮2" />
        <input id="Button11" type="button" value="增加一个按钮3" />
        <input id="Button12" type="button" value="增加一个分割线" />
    <hr />
    <div id="tt" class="easyui-toolbar" data-options="" >
        <span>用户姓名：</span>
        <input type="text" style="margin-left: 2px; margin-right: 2px;" />
        <a class="easyui-linkbutton" data-options="plain: true, iconCls: 'icon-hamburg-zoom'" >查询</a>
        <div class="dialog-tool-separator"></div>
        <a class="easyui-linkbutton" data-options="plain: true, iconCls: 'icon-hamburg-config'" >配置</a>
        <span>-</span>
        <a class="easyui-linkbutton" data-options="plain: true, iconCls: 'icon-hamburg-pencil'" >编辑</a>
        <a class="easyui-linkbutton" data-options="plain: true, iconCls: 'icon-hamburg-busy'" >删除</a>
    </div>

</textarea>


</div>